

#include "OutputController.h"



OutputController::OutputController(IOutputView* view) 
{
    if (!view)
       throw ("view may not be null");

    view_m = view;
}
    
OutputController::~OutputController()
{
    delete oButton_m;
    delete radioButtonCasc_m;
    delete radioButtonInch_m;
}

void OutputController::attachComponent(Button* b, RadioButton* rb1, RadioButton* rb2)
{
    oButton_m = b;
    radioButtonCasc_m = rb1;
    radioButtonInch_m = rb2;
}
	
void OutputController::button_onClick()
{
    view_m->update();
}	
  
void OutputController::radioButton_onSelected()
{
    radioButtonCasc_m->onSelected();//mutex with two radioButton
    radioButtonInch_m->onSelected();
    view_m->update();
}

/*
private:
    void InitializeComponent()
    {    
        oButton_m->onClick += new System.EventHandler(button_onClick);
        radioButtonCasc_m->onSelected += new System.EventHandler(radioButton_onSelected);
    }
*/	


